import { PageParams, PageResult } from '@/types/global'
import { InterviewReportItem } from '@/types/interview'
import { http } from '@/utils/http'

// 发送消息给AI面试官
export const sendMessageToAI = (params) => {
  http.get('/member/interview/streamChat', params)
}

// 语音识别
export const AudioToTextAPI = (params) => {
  return http({
    method: 'POST',
    url: '/member/interview/audioToText',
    data: params,
    header: {
      'Content-Type': 'application/octet-stream'
    }
  })
}

// 获取面试报告列表
export const getInterviewReportListAPI = (params: PageParams) => {
  return http<PageResult<InterviewReportItem>>({
    method: 'GET',
    url: '/member/interview/report/list',
    data: params
  })
}

// 获取面试报告详情
export const getInterviewReportDetailAPI = (id: string) => {
  return http<InterviewReportItem>({
    method: 'GET',
    url: `/member/interview/report/${id}`
  })
}